//倒计时封装
export default function countdown(downTime,val) {
    //downTime给一个ref创建的数字,val：重置时间
    let timer = setInterval(() => {
        --downTime.value
        if (downTime.value <= 0) {
            clearInterval(timer);
            downTime.value = val;
        }
    }, 1000);
}